home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Format (UK) 75
/
PC Format 75 - Nov 1997.iso
/
Tech
/
WM30DEMO
/
ENGRNG
/
MECHSMS
/
PISTON.WBS
< prev
next >
Wrap
Text File
|
1995-06-30
|
2KB
|
62 lines
' ******************************************************************************
' Piston Engine Script - RUNS PISTON ENGINE SIMULATION WITH DIFFERENT CONNECTING
' ROD LENGTHS
'
' This simple script works with the PISTON ENGINE demo file. It varies the
' engine connecting rod length several times and runs several frames,
' both based on constants located at the beginning of the script. It
' then saves the data from several meters in a file the user enters in
' a dialog box.
' Version 1.0, Created by Knowledge Revolution
' (C) Copyright Knowledge Revolution 1995 All Rights Reserved
'
' ******************************************************************************
Sub Main()
Const NumberOfRuns as integer = 5
Const NumberOfFrames as integer = 75
Const StepSize as double = 0.5
Dim Doc as WMDocument
Dim B as WMBody
Dim index as integer
Dim meterfile as string
Set Doc = WM.ActiveDocument
Set B = Doc.Body("Connecting Rod")
B.Width.Value = 12
Doc.StartHere
Doc.RetainMeterValues = True
Doc.EraseMeterValues
For index = 1 to NumberOfRuns
Doc.run NumberOfFrames
Doc.reset
B.Width.Value = B.Width.Value - StepSize
Next index
Doc.reset
B.Width.Value = 12
Doc.select Doc.Output("Ignition Power"), True
Doc.select Doc.Output("Engine Speed"), True
Doc.select Doc.Output("Wrist Pin Force"), True
Doc.select Doc.Output("Piston Stroke"), True
meterfile = SaveFilename$("Save Meter Export File")
If meterfile <> "" then
Doc.ExportStartFrame = 0
Doc.ExportStopFrame = NumberOfFrames
Doc.ExportMeterData meterfile
end if
Doc.Selectall False
Doc.reset
End Sub